import React from "react";
import {ATagProps, SeatProps, TextProps, WrapProps} from "../types/layout";
import s from "./cms.module.less"
import {message} from "antd";
import classNames from "classnames";

export const Text: React.FC<TextProps> = ({color = "#1890ff", children}) => {
    return <span style={{color}} className={s.handle}>
        {children}
    </span>

}
export const Seat: React.FC<SeatProps> = ({h,w}) => {
    if (w){
        return <div style={{width:w,display:"inline-block"}} />
    }
    return <div style={{height: h}}/>
}

export function showMsg() {
    message.info("还未实现！")
}

export const Wrap: React.FC<WrapProps> = ({children}) => {
    return <div className={s.wrap}>
        {children}
    </div>
}

export const ATag: React.FC<ATagProps> = (props) => {
    const {children, disabled,onClick=()=>{}, ...args} = props;
    return <a
        className={classNames({
            [s.disabled]: disabled
        })}
        onClick={disabled?()=>{}:onClick}
        {...args}
    >
        {children}
    </a>
}